package com.tangding.common.exception;

import java.io.Serializable;

import com.tangding.common.tools.ErrorConstants;

/**
 * @description 
 *
 * @author Ranger
 * @version 2014-11-6_上午10:13:37
 *
 */
public class GException extends Exception implements Serializable {
    private static final long serialVersionUID = 1L;
	private int err = ErrorConstants.SUCC;
	private String msg;
	public int getErr() {
		return err;
	}
	public String getMsg(){
		return msg;
	}
	public GException(int err) {
		this.err = err;
	}
	public GException(Throwable e) {
		super(e);
		this.err = ErrorConstants.FAIL;
		this.msg = e.getMessage();
	}
	
	public GException(int err, String msg) {
		super();
		this.err = err;
		this.msg = msg;
	}
	
	public GException(int err, Throwable e) {
		super(ErrorConstants.getDesc(err), e);
		this.err = err;
		this.msg = ErrorConstants.getDesc(err);
	}
	
	public GException(int err, String msg, Throwable e) {
		super(msg, e);
		this.err = err;
		this.msg = msg;
	}
}
